from typing import List


class Solution:
    def zeroFilledSubarray(self, nums: List[int]) -> int:
        flag = 0
        ret = 0
        for num in nums:
            if num == 0:
                flag += 1
                continue
            if num != 0 and flag > 0:
                ret += (1 + flag) * flag // 2
            flag = 0
        ret += (1 + flag) * flag // 2
        return ret
